﻿@{
    ViewBag.Title = "Index";
}

@using System.Diagnostics;
@using System.IO;
@using Dashboard.Models

@Styles.Render("~/Content/font-awesome.min.css")
@Styles.Render("~/Content/Logs.css")
@Styles.Render("~/Content/Site3.css")

<div id="container" style="width: 100%; height: 100%">
    <h2>Logs</h2>

    <div class="Custom-logs">
        <h3>Custom Logs</h3>
        <ul class="group">
            @foreach (KeyValuePair<string, int> pair in ViewBag.listOfCustomLogs)
            {
                if (pair.Value == 0)
                {
                <li class="group-item">
                    <a href="@String.Concat("/Logs/DownloadLogsDirectory/", Dashboard.Models.LogsManager.GetNameFromPath(pair.Key))">
                        <i class="fa fa-folder fa-2x"></i>
                        <span>@pair.Key</span>
                    </a>
                </li>
                }
                else
                {
                    if (pair.Value == 1)
                    {
                <li class="group-item">
                    <a href="@String.Concat("/Logs/DownloadLogWithName/", Dashboard.Models.LogsManager.GetNameFromPath(pair.Key))">
                        <i class="fa fa-file fa-2x"></i>
                        <span>@pair.Key</span>
                    </a>
                </li>
                    }
                    else
                    {
                <li class="group-item">
                    <span>
                        <i class="fa fa-warning fa-2x"></i>
                        @pair.Key was not found
                    </span>
                </li>
                    }
                }
            }
        </ul>
    </div>

    <div class="Windows-logs">
        <h3>Windows logs</h3>
        <ul class="group">
            @foreach (EventLog e in ViewBag.listOfWinLogs)
            {   
                <li class="group-item">

                    <span>
                        <i class="fa fa-file fa-2x"></i>
                        <a href="@String.Concat("/Logs/DownloadWindowsLog/", String.Concat(e.Log, ".evtx"))">@e.Log</a>
                    </span>
                </li>  
            }
        </ul>
    </div>
</div>
